/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package admin.provider;

import admin.util.UtilEjb;
import ejb.attribute.KscEventJndi;
import ejb.bean.AbstractFacade;
import ejb.bean.NewsFacade;
import ejb.entity.News;

public class NewsProvider extends WrapperProvider<News> {

    public static NewsProvider getInstance() {
        return NewsProviderHolder.INSTANCE;
    }

    public NewsProvider() {
        super(News.class);
    }

    @Override
    public AbstractFacade<News> getAbstractFacade() {
        return getNewsFacade();
    }

    private NewsFacade getNewsFacade() {
        return UtilEjb.getInstance().<NewsFacade>getEJB(KscEventJndi.NEWS_BEAN);
    }

    private static class NewsProviderHolder {

        private static final NewsProvider INSTANCE = new NewsProvider();

        private NewsProviderHolder() {
        }
    }
}
